#include<stdio.h>

int main()
{
	FILE* pf1 = fopen("data.txt", "r");
	if (pf1 == NULL)
	{
		perror("fopen");
		return 1;
	}
	/*fputs("abcdefg", pf1);*/
	char ch[10] = { 0 };
	fgets(ch, 10, pf1);
	FILE* pf2 = fopen("data_copy.txt", "w");
	if (pf2 == NULL)
	{
		perror("fopen");
		return 1;
	}
	fputs(ch, pf2);
	fclose(pf1);
	fclose(pf2);
	pf1 = NULL;
	pf2 = NULL;
	return 0;
}